﻿using INTEX.DataBase.Tools;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.Data.OracleClient;
using ReflectionStudio.Components.UserControls;
using System.ComponentModel;
namespace WPFExcelReport
{
    public partial class TAB04
    {  
        public TAB04()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VABKOPF();
            DataContext = MV;
            InitializeComponent();
        }
        public override void NewCommand(object sender, RoutedEventArgs e)
        {
            if (KRS.Trim().Length == 0)
            {
                Tracer.Info("TAB04","必须指定生产单前缀"); 
                return;
            }
            if (AUFART.Trim().Length == 0)
            {
                Tracer.Info("TAB04", "必须指定生产单类型"); 
                return;
            }
            PM["RUNID"] = this.RUNID;
            PM["KRS"] = KRS;
            PM["AUFART"] = AUFART;
            PM["ORDERNUM"] = KDAUFTNR;
            PM["RELOADABK"] = false;
            TMV.NEWABK(PM);
            vwMaster.View.MoveCurrentToFirst();
            base.NewCommand(sender, e);
        }
        public override void OnAutoChg(bool value)
        {
            if (!IsAuto)
                return;
            NewCommand(null, null);
            base.OnAutoChg(value);
        }
    }
}

